Skip to content

fix: PWD=/ when launched from finder#352

Merged
ellie merged 1 commit intomainfrom
ellie/terminal-dir-fallback
Jan 16, 2026
Merged

fix: PWD=/ when launched from finder#352
ellie merged 1 commit intomainfrom
ellie/terminal-dir-fallback

Conversation

@ellie
Copy link
Member

@ellie ellie commented Jan 16, 2026

Launching from finder caused pwd=/ on macos, leading to weird terminal + script behaviour

I'm unsure how widespread this is, but we likely didn't catch it sooner because most of our runbooks have directory blocks or we launch the app from the terminal

I don't think this happened on Linux

Tasks

  • Regenerated TS-RS bindings (if any ts(export) structs have changed)
  • Updated the documentation in docs/ (if any application behavior has changed)
  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle

@ellie ellie marked this pull request as ready for review January 16, 2026 23:24
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

Fixes PWD being set to "/" when launching the desktop app from Finder on macOS by explicitly checking and skipping the "/" value.

  • Added pwd != "/" check in default_cwd() function to filter out the useless root directory value that macOS sets for GUI apps launched from Finder
  • Falls back to home directory when PWD is "/" instead of using it as the working directory
  • Updated comment to clarify the macOS Finder behavior

Important Files Changed

Filename Overview
crates/atuin-desktop-runtime/src/context/resolution.rs Added check to skip PWD="/" on macOS Finder launches, falling back to home directory instead

@ellie ellie merged commit 50fa076 into main Jan 16, 2026
9 checks passed
@ellie ellie deleted the ellie/terminal-dir-fallback branch January 16, 2026 23:30
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant